-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix importing module metadata from REMI's repositories #9003
Conversation
@@ -286,7 +286,7 @@ def _parse_rpm_name(nevra): | |||
pattern = re.compile( | |||
r"(?P<name>[a-zA-Z0-9._+-]+)-" | |||
r"(?P<epoch>\d+:)?" | |||
r"(?P<version>[a-zA-Z0-9._-]+)-" | |||
r"(?P<version>[a-zA-Z0-9._-~]+)-" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is a hyphen/dash inside the version string valid? openSUSE's packaging documentation says it's not available, does that differ in the RH world?
RPM uses the dash to separate the package name, the package version and the distro-level re-issue ("release") counter. (
rpm -qa
for example emits coreutils-9.0-1.x86_64.) The dash itself is unavailable for use within the version or release substring, as are a few other characters like the asterisk. [...]
https://en.opensuse.org/openSUSE:Package_versioning_guidelines#Unusual_characters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The real problem is that there's no actual standard between distros and like also mentioned there in the document, some distros are pretty liberal with this.
For "hyphens in version" case, Ubuntu/Debian is the offender. Here are some examples:
ipxe-qemu-256k-compat-efi-roms-1.0.0+git-20150424.a25a16d-0ubuntu4.all-deb.deb
ipxe-1.0.0+git-20190109.133f4c4-0ubuntu3.all-deb.deb
ipxe-qemu-1.0.0+git-20190109.133f4c4-0ubuntu3.all-deb.deb
grub-ipxe-1.0.0+git-20190109.133f4c4-0ubuntu3.all-deb.deb
lib32gcc1-10-20200411-0ubuntu1.amd64-deb.deb
libx32gcc1-10-20200411-0ubuntu1.amd64-deb.deb
I should probably add some more test cases reflecting this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is appstreams.py also used by Debian repos? I thought this was RPM-only.
Package version schemas definitely differ between packaging formats and we can't have one way to handle all of them. The same applies to version comparisons, where has their own rules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libsolv
has some version comparison algorithms from which maybe some reasonable expectations for a version string can be extracted:
https://github.com/openSUSE/libsolv/blob/master/src/evr.c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can have a look at it if it covers all the necessary formats. But in any case, further changes are not in scope for this fix and I don't want to risk any regressions without testing extensively. So I'm just going to merge this one as is.
Some packages in REMI's 3rd party repositories include a '~' character as part of the version string. This patch fixes the module import during repo-sync to recognize this character.
Documentation
Test coverage
Links
Fixes #8972
Changelogs
Make sure the changelogs entries you are adding are compliant with https://github.com/uyuni-project/uyuni/wiki/Contributing#changelogs and https://github.com/uyuni-project/uyuni/wiki/Contributing#uyuni-projectuyuni-repository
If you don't need a changelog check, please mark this checkbox:
If you uncheck the checkbox after the PR is created, you will need to re-run
changelog_test
(see below)Re-run a test
If you need to re-run a test, please mark the related checkbox, it will be unchecked automatically once it has re-run:
Before you merge
Check How to branch and merge properly!